package com.design.singleton;


public class InnerSingleton {

    private InnerSingleton() {
        if (InnerHolder.singleton != null) {
            throw new RuntimeException("Singleton is not null");
        }
    }

    private static class InnerHolder {
        private static final InnerSingleton singleton = new InnerSingleton();

    }

    public static InnerSingleton get() {
        return InnerHolder.singleton;
    }

}
